# This file is part of BlackArch Linux ( https://www.blackarch.org/ ).
# See COPYING for license details.

pkgname=jbrute
pkgver=0.99
pkgrel=5
epoch=1
groups=('blackarch' 'blackarch-cracker')
pkgdesc='Open Source Security tool to audit hashed passwords.'
arch=('any')
url='http://sourceforge.net/projects/jbrute/'
license=('GPL3')
depends=('java-environment')
source=("https://netcologne.dl.sourceforge.net/project/$pkgname/JBrute_v${pkgver//./-}.zip")
sha512sums=('4b89ef838e2c9fa243119ffc07ebbf89050af9e3d15d7921fa959adada8be9ec8702b6ef6dac3f4dfb2a38e3bcec2fc35f9158c8b159c277b3281edb7d8dd714')

package() {
  cd JBrute

  install -dm 755 "$pkgdir/usr/bin"
  install -dm 755 "$pkgdir/usr/share/jbrute"

  install -m 755 JBrute.jar "$pkgdir/usr/share/$pkgname/"
  install -m 644 rules.txt "$pkgdir/usr/share/$pkgname/"

  cat >> "$pkgdir/usr/bin/$pkgname" << EOF
#!/bin/sh
java -Xms128m -Xmx512m -jar /usr/share/$pkgname/JBrute.jar "$@"
EOF

  chmod +x "$pkgdir/usr/bin/$pkgname"
}

